package com.cqie.constant;

import lombok.Data;

/**
 * 操作人: 不吃海鲜
 * 时间: 2024/12/4 17:09
 */

public enum PublicationTypeEnum {
    All("0", "全部"),
    NOTICE("1", "通知"),
    NEWS("2", "新闻"),
    OTHER("3", "其他");
    private String code;
    private String desc;
    PublicationTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDescriptionByCodeStr(String codeStr) {
        for (PublicationTypeEnum enumValue : PublicationTypeEnum.values()) {
            if (enumValue.getCode().equals(codeStr)) {
                return enumValue.getDesc();
            }
        }
        // 如果没有找到匹配的codeStr，返回null
        return null;
    }

}
